package com.financial.service.yspay.controller;


import com.financial.service.yspay.service.FinancialYsPayPaymentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @Author: WANGNING
 * @Email wyn20140226@aliyun.com
 * @Date: 2019/6/5 8:40
 * @Des 银盛代打款接口（非一清）
 */
@RestController
@RequestMapping("/ysPayment")
public class FinancialYsPayPaymentControllrt {
    private static Logger log = LoggerFactory.getLogger(FinancialYsPayPaymentControllrt.class);
    @Autowired
    private FinancialYsPayPaymentService ysPaymentService;

    /**
     * @return
     * @Author zhaopengjun
     * @Description //银盛单笔代付接口（非一清待打款接口）
     * @Date 9:58 2019/5/24
     * @Param
     **/
    @PostMapping("/payment")
    public Map<String, Object> transferAccounts(@RequestParam Map<String, Object> mapParams) {
        System.out.println("----------- 银盛非一清待打款接口---------------");

        return ysPaymentService.payment(mapParams);
    }

    /**
     * @return
     * @Author zhaopengjun
     * @Description //银盛非一清代付查询接口
     * @Date 15:33 2019/6/17
     * @Param
     **/
    @PostMapping("/paymentQuery")
    public Map<String, Object> paymentQuery(@RequestParam Map<String, Object> mapParams) {
        return ysPaymentService.paymentQuery(mapParams);
    }


    /**
     * @return java.lang.String
     * @Author zhaopengjun
     * @Description //银盛异步代打款回执接口（一清）
     * @Date 15:12 2019/5/22
     * @Param [returnString]
     **/
    @PostMapping("/asyncPayment")
    public void asyncPayment(HttpServletRequest request, HttpServletResponse response) {
        ysPaymentService.asyncPayment(request, response);

    }


}
